<include file="Public/head" />
<include file="Public/menu" />
<include file="Manager/menu" />
<link href="__PUBLIC__/Admin/css/hwLayer.css" rel="stylesheet" type="text/css" />
      <div class="container">
            <div class="demo">
                <div class="optlist">
                    <a class="btn  show-layer" data-show-layer="hw-layer" role="button" style="float:right;margin-right:20px">添加管理员</a>
                </div>
                <div class="hw-overlay" id="hw-layer">
                    <div class="hw-layer-wrap">
                        <span class="glyphicon glyphicon-remove hwLayer-close"></span>
                        <div class="row">
                            <div class="col-md-9 col-sm-12">
                                    <form action="{:U('Managerlist/add_admin')}" method="post" class="col-md-9 col-sm-12">
                                        <font class="fontstyle">管理员名称：</font><input class="ipt" type="text" name="username" placeholder="请输入管理员名称" style="border:1px solid #c2c2c2"><br><br>
                                        <font class="fontstyle">管理员邮箱：</font><input class="ipt" type="text" name="email" placeholder="请输入邮箱地址" style="border:1px solid #c2c2c2"><br><br>
                                        <font class="fontstyle">管理员密码：</font><input id="password" class="ipt" type="password"  name="password" placeholder="请输入密码" style="border:1px solid #c2c2c2"><br><br>
                                        <font class="fontstyle">请选择角色：</font>
                                        <select name="role_id">
                                        <option value="0">不添加角色</option>
                                        <volist name="role" id="v">
                                          <option value="{$v.id}">{$v.role_name}</option>
                                        </volist>
                                        </select>
                                        <br><br>
                                        <input type=hidden name="add_time" value="{:time()}">
                                        <input class="btn  show-layer" type="submit"  value="保存" style="float:right">
                                    </form>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
     </div>
     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo">
      <tbody>
       <tr>
        <td width="100%" valign="top" class="pr">
         <div class="indexBox">
          <div class="boxTitle">
           管理员基本信息
          </div>
          <ul>
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
            <tr>
              <th width="22" align="center"><input name='chkall' type='checkbox' id='chkall' onclick='selectcheckbox(this.form)' value='check'></th>
              <th width="40" align="center">ID编号</th>
              <th width="70" align="center">管理员名称</th>
              <th width="150" align="center">管理员角色</th>
              <th width="80" align="center">管理员邮箱</th>
              <th width="80" align="center">添加时间</th>
              <th width="80" align="center">禁用状态</th>
              <th width="100" align="center">操作</th>
            </tr>
            <volist name="admin_member" id="v">
               <tr>
                <td align="center"><input type="checkbox" name="checkbox[]" value="15" /></td>
                <td align="center">{$v.id}</td>
                <td align="center">{$v.username}</td>
                <td align="center">
                  <eq name="v.role_id" value="0">
                    <a href="{:U('Managerlist/edit_admin')}&id={$v.id}&role_name={$v.role_name}">去添加角色</a>
                  <else />
                    {$v.role_name}
                  </eq>
                </td>
                <td align="center">{$v.email}</td>
                <td align="center">{:date("Y/m/d H:i:s",$v['add_time'])}</td>
                <td align="center">
                  <eq name="v.state" value="0">
                    禁用
                  <else />
                    启用
                  </eq>
                </td>
                <td align="center">
                  <a href="{:U('Managerlist/edit_admin')}&id={$v.id}&role_name={$v.role_name}">编辑</a> | 
                  <a href="{:U('Managerlist/edit_password')}&id={$v.id}">密码修改</a> | 
                  <a href="{:U('Managerlist/delete_admin')}&id={$v.id}">删除</a> 
                </td>
               </tr>
            </volist>
            </table>
            <div class="pager">总计 15 个记录，共 1 页，当前第 1 页 | <a href="product.php?page=1">第一页</a> 上一页 下一页 <a href="product.php?page=1">最末页</a></div>
          </ul>
         </div> </td>
        <td valign="top" class="pl">
       </tr>
      </tbody>
     </table>
    </div>
   </div>
	<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
	<script>
	    $(function() {
	        //展示层
	        function showLayer(id) {
	            var layer = $('#' + id),
	                    layerwrap = layer.find('.hw-layer-wrap');
	            layer.fadeIn();
	            //屏幕居中
	            layerwrap.css({
	                'margin-top': -layerwrap.outerHeight() / 2
	            });
	        }

	        //隐藏层
	        function hideLayer() {
	            $('.hw-overlay').fadeOut();
	        }

	        $('.hwLayer-ok,.hwLayer-cancel,.hwLayer-close').on('click', function() {
	            hideLayer();
	        });

	        //触发弹出层
	        $('.show-layer').on('click', function() {
	            var layerid = $(this).data('show-layer');
	            showLayer(layerid);
	        });

	        //点击或者触控弹出层外的半透明遮罩层，关闭弹出层
	        $('.hw-overlay').on('click', function(event) {
	            if (event.target == this) {
	                hideLayer();
	            }
	        });

	        //按ESC键关闭弹出层
	        $(document).keyup(function(event) {
	            if (event.keyCode == 27) {
	                hideLayer();
	            }
	        });
	    });
	</script>
<include file="Public/footer" />
